program PROB032;
uses crt;
const
  max = 1000;
var
  used : array[1..9] of longint;
  dd : array[1..10000] of boolean;
  last, time, temp, sum, m, n : longint;

function ok(a, b, c : longint) : boolean;
var
  kt, ss : longint;
begin
  ss := 0;
  ok := false;
  inc(time);
  while b > 0 do
  begin
    inc(ss);
    if ss > 9 then exit;
    kt := b mod 10;
    if kt = 0 then exit;
    if used[kt] = time then exit;
    used[kt] := time;
    b := b div 10;
  end;
  while c > 0 do
  begin
    inc(ss);
    if ss > 9 then exit;
    kt := c mod 10;
    if kt = 0 then exit;
    if used[kt] = time then exit;
    used[kt] := time;
    c := c div 10;
  end;
  while a > 0 do
  begin
    inc(ss);
    if ss > 9 then exit;
    kt := a mod 10;
    if kt = 0 then exit;
    if used[kt] = time then exit;
    used[kt] := time;
    a := a div 10;
  end;
  ok := ss = 9;
end;

begin
  clrscr;
  time := 0;
  for m := 2 to 100 do
  begin
    last := 987654321 div m;
    if last > 10000 then last := 10000;
    for n := m+1 to last do
    begin
      temp := m*n;
      if ok(m, n, temp) then
        if not dd[temp] then
        begin
          writeln(m, '*', n, ' = ', temp);
          dd[temp] := true;
          inc(sum, temp);
        end;
    end;
  end;
  writeln(sum);
end.